package com.cwx.mychat.mappers;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cwx.mychat.entity.po.UserInfo;
import com.cwx.mychat.entity.vo.SearchUserVo;
import com.cwx.mychat.entity.vo.UserInfoVO;
import com.cwx.mychat.service.impl.UserContactServiceImpl;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {
    /**
     * 根据phone和beautifulNumber连表搜索好友
     * @param searchInfo
     * @return
     */
    List<SearchUserVo> selectFriendsByPB(@Param("searchInfo") String searchInfo, @Param("userId") String userId);

    /**
     * 联表查询所用户信息
     *
     * @param contactIds
     * @return
     */
    List<UserInfoVO> selectAll(@Param("contactIds") List<String> contactIds);

    /**
     * 跟距联系人Id查询用户信息
     * @param contactId
     * @return
     */
    UserInfoVO selectUserById(@Param("contactId") String contactId);
}
